Skip to content

Expose observed task resource targets - #461

Merged
schickling merged 2 commits into
schickling-assistant/2026-09-05-2026-09-05-scope-argvfrom
schickling-assistant/2026-09-05-2026-09-05-resource-target-2
Sep 5, 2026
Merged

Expose observed task resource targets#461
schickling merged 2 commits into
schickling-assistant/2026-09-05-2026-09-05-scope-argvfrom
schickling-assistant/2026-09-05-2026-09-05-resource-target-2

Conversation

@schickling-assistant

@schickling-assistant schickling-assistant commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Problem

st2 tasks --json identifies live task generations but does not expose a truthful resource-observation target. Downstream collectors would otherwise have to parse transient scope names, treat PIDs as identity, or maintain a second registry.

Goal

Expose a typed, fail-closed resource target for each observed runtime generation without turning PID, cgroup path, or process generation into task identity.

Decisions

  • Advance task inventory to st2.task-inventory.v2 with linuxCgroupV2, darwinProcessTree, and bounded unavailable variants.
  • Derive Linux targets from /proc/<pid>/cgroup; never parse systemd unit names.
  • Fence exec targets with kernel start tokens.
  • For PTYs, bracket one socket-backed pty stats --json snapshot per inventory with kernel start-token reads. Require a unique live row with matching session name, daemon PID, and creation time.
  • Keep PTY generation IDs based on stable PID/creation evidence. Transient target availability cannot change identity.

Verification

  • nix develop --command cargo test --lib task_inventory::tests — 13 passed.
  • nix develop --command cargo test --test task_inventory_cli — 14 passed.
  • Focused PID-reuse, socket-proof, one-stats-per-inventory, generation-stability, and real PTY replacement regressions pass.
  • Full tests: 684 passed, 10 failed, 1 ignored; pristine current main fails the same 10 tests with 677 passed, 10 failed, 1 ignored.
  • New requirements, ontology, spec, decision, and experiment records pass strict VRS shape checks.
  • Rebased onto Preserve argv through systemd scope wrappers #455/current main; no review threads are open.

Pre-flip deviations

  • Full clippy stops at the unchanged manual_is_multiple_of warning in crates/st2-resource-protocol/src/lib.rs:410. The same package-level command fails identically on pristine current main.
  • The 10 full-test failures are identical to pristine current main and do not exercise task inventory or resource targets.

Complexity

The socket-backed PTY proof adds one bounded stats snapshot per inventory. The extra proof is necessary because registry-only PTY metadata cannot exclude PID reuse.

Concerns

The Darwin target is a best-effort process-tree root. st2 does not aggregate Darwin process resources. Linux cgroup-v2 is the first downstream accounting backend.

Friction & bottlenecks

The repository-wide baseline deviations are documented above. The focused inventory and real PTY scenarios are green.

Follow-ups

References

Posted on behalf of @schickling
field value
agent_identity mbp2025.direct.omp.5tek2r48
session mbp2025.5tek2r48
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.0.11
agent_runtime OMP 18.0.11
tooling_profile dotfiles@4cc7b25

@schickling-assistant schickling-assistant changed the title schickling assistant/2026 09 05 2026 09 05 resource target 2 Expose observed task resource targets Sep 5, 2026
@schickling-assistant
schickling-assistant force-pushed the schickling-assistant/2026-09-05-2026-09-05-resource-target-2 branch from e5b103a to 0114f21 Compare September 5, 2026 14:04
@schickling-assistant
schickling-assistant marked this pull request as ready for review September 5, 2026 14:33
@schickling

Copy link
Copy Markdown
Contributor

@codex

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T17:43:16.121173Z 7957541 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 0114f215f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

agent-identity: mbp2025.direct.omp.5tek2r48
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.11
agent-runtime: OMP 18.0.11
tooling-profile: dotfiles@4cc7b25
agent-identity: mbp2025.direct.omp.5tek2r48
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.11
agent-runtime: OMP 18.0.11
tooling-profile: dotfiles@4cc7b25
@schickling
schickling force-pushed the schickling-assistant/2026-09-05-2026-09-05-resource-target-2 branch from 0114f21 to 7957541 Compare September 5, 2026 17:39
@schickling
schickling merged commit d4af275 into main Sep 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants